package com.rlax.ccdemo.service.user.fegin;

import cn.hutool.core.bean.BeanUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.rlax.ccdemo.service.api.user.dto.UpmsUserDTO;
import com.rlax.ccdemo.service.api.user.fegin.IUpmsUserApi;
import com.rlax.ccdemo.service.user.service.UpmsUserService;
import com.rlax.corebin.core.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户微服务
 *
 * @author Rlax
 * @since 2020-12-10
 */
@RestController
@AllArgsConstructor
@Api(value = "用户微服务", tags = "用户微服务")
public class UpmsUserApi implements IUpmsUserApi {

	private final UpmsUserService upmsUserService;

	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "详情", notes = "传入id")
	@Override
	public R<UpmsUserDTO> get(Long id) {
		return R.success(BeanUtil.toBean(upmsUserService.getById(id), UpmsUserDTO.class));
	}

}
